#include<stdio.h>
int add(int x)
{
	int sum = 2 * x - 1;
	return sum;
}

int app(int x)
{
	int sum = 3 * x - 11;
	return sum;
}

int main()
{
	int x;
	scanf_s("%d", &x);

	if (x < 1)
	{
		printf("%d", x);
	}
	else if (1 <= x && x < 10)
	{
		int result1 = add(x);
		printf("%d",result1);
	}
	else
	{
		int result2 = app(x);
		printf("%d",result2);
	}
}
